<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>重庆大学硕士研究生服务系统</title>
<?php $this->load->view('includes/ga_head'); ?>  
<script src="<?php echo $includes_dir;?>js/editor_config.js?v=1.0"></script>
<script src="<?php echo $includes_dir;?>js/editor_all.js?v=1.0"></script>
</head>
<!--[if lt IE 7 ]> <body class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <body class="ie ie7 "> <![endif]-->
<!--[if IE 8 ]> <body class="ie ie8 "> <![endif]-->
<!--[if IE 9 ]> <body class="ie ie9 "> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> 
<body class=""> 
<!--<![endif]-->
<?php $this->load->view('includes/ga_navbar'); ?>  
<?php $this->load->view('includes/ga_sidebar'); ?>  
<div class="content">
    <div class="header">
        <h1 class="page-title">公告信息</h1>
    </div>
    <ul class="breadcrumb">
        <li><a href="#">Home</a> <span class="divider">/</span></li>
        <li class="active">公告浏览</li>
    </ul>

    <div class="container-fluid">
        <div class="row-fluid">
<?php $this->load->view('includes/ga_message'); ?>  
    <div class="block span9 offset1">
        <a href="#tablewidget" class="block-heading" data-toggle="collapse">公告信息</a>
        <div id="tablewidget" class="block-body collapse in">
            <table class="table">
              <thead>
                <tr>
  	    <th>时间</th>
		<th>公告标题</th>
		<th>上传者</th>
                </tr>
              </thead>
	<?php if (!empty($newsListInfo)) { ?>
              <tbody>
	<?php foreach ($newsListInfo as $news) { ?>
                <tr>
  	<td><?php echo $news['approval_time'];?></td>								
		<td>
			<a href="<?php echo $base_url;?>gass_news/public_news_details/<?php echo $news['news_id'] ?>"><?php echo $news['news_title'];?></a>
		</td>
		<td><a href="#recid<?php echo $news['news_create_person']; ?>">
			<?php $userInfo = $this->flexi_auth->get_user_by_id($news['news_create_person'])->row_array();echo $userInfo['upro_first_name'].' '.$userInfo['upro_last_name'];?>
		</a></td>
                </tr>
	<?php } ?>
              </tbody>
	<TFOOT>
  <TR>
    <TD colSpan=3><?php if (! empty($pagination['links'])) { ?>
 	   总数: 共 <?php echo $pagination['total_public_news'];?> 条查询结果
	   链接: <?php echo $pagination['links'];?>
 	   <?php } ?>
    </TD> 
  </TR>
  </TFOOT>		
	<?php } else { ?>
	<tbody>
	<tr>
		<td colspan="3" class="highlight_red">没有任何提交审批的公告</td>
	</tr>
	</tbody>
<?php } ?>				
            </table>
        </div>
    </div>

<?php $this->load->view('includes/ga_footer'); ?>  
        </div>
    </div>
</div>
<?php $this->load->view('includes/ga_scripts'); ?>
<script>
$(function() {
var recId = 0;
$("[href*='#recid']").each(function(i){
$(this).bind('click',function(){
    var href = $(this).attr("href");
    recId = href.substring(6,href.length);
    if ( recId == <?php echo $this->flexi_auth->get_user_id(); ?> ){
       alert("不允许向自己发信息");
       return false;
    }else{
    bootbox.prompt("发送站内信", function(result) 
    {                
        if (result === null) {                                             
        } else {
				 if (result.length==0||result.length>140){
						alert('信息长度有误，请控制在75个字以内！');
						return false;
                 }
                 $.ajax({
                    type:"post",
                    data: "recId=" + recId + "&text=" + result,
                    url: "<?php echo base_url();?>gass_message/send_message",
                    success: function(result1){
                       //$("#photoboard").fadeTo("slow", 0.85).fadeIn("normal").html(result);
                       alert("发送成功");
                       //$( "#dialog-form" ).dialog( "close" );
                    },
                    error: function(){
                       //$("#loading_message").hide();
                       alert("ajax error");
                    }
                 });
        //alert(result);
        }
     });
                
	  		}	
	  	});
	  });		
	
});
</script>  

</body>
</html>
